/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.minhphuong.bll;

import com.minhphuong.dal.*;
import com.minhphuong.entities.*;

import java.util.List;
import javax.servlet.http.HttpSession;

/**
 *
 * @author QuocMinh
 */
public class NguoiDungBLL {

    public static List<NguoiDung> getAllNguoiDung() {
        List<NguoiDung> listNguoiDung = NguoiDungDAL.getAllNguoiDung();
        return listNguoiDung;
    }

    public static boolean insertNguoiDung(NguoiDung nguoidung) {
        nguoidung.setMaNd(HelperBLL.getNextID("NguoiDung", "maNd"));
        return NguoiDungDAL.insertNguoiDung(nguoidung);
        //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    public static String create_captcha(int n) {
        return NguoiDungDAL.create_captcha(n);
        //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    public static NguoiDung checkLogin(String email, String matKhau) {
        return NguoiDungDAL.checkLogin(email, matKhau);
        //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    static NguoiDung checkSession(HttpSession session) {
        return NguoiDungDAL.checkSession(session);
        //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }
    public static NguoiDung getNguoiDungByID(int id)
    {
        return NguoiDungDAL.getNguoiDungByID(id);
    }
    public static void updateNguoiDung(NguoiDung nguoidung)
    {
        NguoiDungDAL.updateNguoiDung(nguoidung);
    }
}
